package dao

/*
*  -*- coding:utf8 -*-
*
*  数据库相关语句
*
*  @Author  : chengms
*  @WebSite : chengms.com
*  @Email   : chengms2012@163.com
*  @TIME    : 2020/8/26 17:17
*  @File    : sql.go
 */

// 建表语句
const (
	// 账户信息基本数据表
	UserInfoTable = "CREATE TABLE user_info( " +
		"uid INT NOT NULL AUTO_INCREMENT, " +
		"user_name VARCHAR(30) NOT NULL," +
		"user_passwd VARCHAR(30) NOT NULL," +
		"email VARCHAR(40) NOT NULL, " +
		"user_sts INT DEFAULT 0," +
		"friend_cnt INT DEFAULT 0," +
		"create_time DATETIME," +
		"reserved VARCHAR(60) ," +
		"reserved2 VARCHAR(60) ," +
		"reserved3 VARCHAR(60) ," +
		"PRIMARY KEY (uid), " +
		"UNIQUE INDEX user(user_name, email ASC))" +
		"ENGINE=InnoDB DEFAULT CHARSET=utf8;"

	// 记录系统信息
	SysInfoTable = "create table sys_info(" +
		"version varchar(10) NOT NULL, " +
		"current_user_id int NOT NULL DEFAULT 100000," +
		"update_time DATETIME)" +
		"ENGINE=InnoDB DEFAULT CHARSET=utf8;"
)

const (
	InsertSysInfo = "insert into sys_info(version, current_user_id, update_time) values (?, ?, ?)"
)
